#include <stdio.h>
#include <stdlib.h>
#include "hexstring.h"
#include "../src/struct_util.h"
int main(int argc, char const *argv[])
{
    int n = 0;
    int argint[10] = {0};
    char *buffer = 0;
    buffer = malloc(255);
    for (int i = 2; i < argc; i++)
    {
        argint[i] = str2int(argv[i]);
    }

    if (argc < 3)
    {
        return 0;
    }
    switch (argc)
    {
    case 3:
    {
        n = struct_util_pack(buffer, argv[1], (argint[2]));
    }
    break;
    case 4:
    {
        n = struct_util_pack(buffer, argv[1], (argint[2]), (argint[3]));
    }
    break;
    case 5:
    {
        n = struct_util_pack(buffer, argv[1], (argint[2]), (argint[3]), (argint[4]));
    }
    break;
    case 6:
    {
        n = struct_util_pack(buffer, argv[1], (argint[2]), (argint[3]), (argint[4]), (argint[5]));
    }
    break;
    case 7:
    {
        n = struct_util_pack(buffer, argv[1], (argint[2]), (argint[3]), (argint[4]), (argint[5]), argint[6]);
    }
    break;
    default:
        break;
    }
    hex_print(buffer, n);

    free(buffer);

    return 0;
}
